cmake_minimum_required(VERSION 3.8)

project(libfuns)

#set(SOURCES funs.cpp)
aux_source_directory(. SOURCES)

set(HEADERS asl.h)

if(MSVC)
    list(APPEND SOURCES funs.def)
    add_definitions(-DASL_EXPORTS)
endif()

if(BUILD_SHARED_LIBS)
    add_library(funs SHARED ${SOURCES} ${HEADERS})
    install(TARGETS funs DESTINATION lib)
endif()

if(BUILD_STATIC_LIBS)
    add_library(funs_static STATIC ${SOURCES} ${HEADERS})
    set_target_properties(funs_static PROPERTIES OUTPUT_NAME "funs")
    install(TARGETS funs_static DESTINATION lib)
endif()

install(FILES ${HEADERS} DESTINATION include)
